<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>会员管理</h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span>列表</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" action="{:U()}" name="form_search">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th><label>昵称</label></th>
          <td><input type="text" value="<notempty name="get.keyword">{$get['keyword']}</notempty>" name="keyword" id="keyword" class="txt"></td>
          <th><label>关注日期:</label></th>
          <td>
            <input class="txt date" type="text" value="<notempty name="get.start_subscribe_time">{$get['start_subscribe_time']}</notempty>" id="start_subscribe_time" name="start_subscribe_time">
            -
            <input class="txt date" type="text" value="<notempty name="get.end_subscribe_time">{$get['end_subscribe_time']}</notempty>" id="end_subscribe_time" name="end_subscribe_time">
          </td>

          <th><label>VIP:</label></th>
          <td>
            <select class="querySelect" name="vip">
              <option <if condition="(isset($get['vip'])) && ($get['vip'] === '')">selected='selected'</if> value="">请选择...</option>
              <option <if condition="(isset($get['vip'])) && ($get['vip'] === 0)">selected='selected'</if> value="0">否</option>
              <option <if condition="(isset($get['vip'])) && ($get['vip'] == 1)">selected='selected'</if> value="1">是</option>
            </select>
          </td>

          <th><label>购买次数</label></th>
          <td>
            <select class="querySelect" name="order_count">
              <option value="">请选择...</option>
              <option <if condition="(isset($get['order_count'])) && ($get['order_count'] == 1)">selected='selected'</if> value="1">1-3次</option>
              <option <if condition="(isset($get['order_count'])) && ($get['order_count'] == 2)">selected='selected'</if> value="2">3-10次</option>
              <option <if condition="(isset($get['order_count'])) && ($get['order_count'] == 3)">selected='selected'</if> value="3">10次以上</option>
            </select>
          </td>

        </tr>
        <tr>
          <th><label>渠道</label></th>
          <td>
            <select class="querySelect" name="channel">
              <option value="">请选择...</option>
              <notempty name="channel">
                <volist name="channel" id="vo">
                  <option <notempty name="get.channel"><eq name="get.channel" value="$key">selected='selected'</eq></notempty> value="{$key}">{$vo}</option>
                </volist>
              </notempty>
            </select>
          </td>
          <td>
            <a href="javascript:document.form_search.submit();" class="btn-search " title="查询">&nbsp;</a>
            <notempty name="get">
              <a href="{:U('index')}" class="btns " title="撤销检索"><span>撤销检索</span></a>
            </notempty>
          </td>
        </tr>
      </tbody>
    </table>
  </form>
<table class="table tb-type2" id="prompt">
	<tbody>
		<tr class="space odd">
			<th colspan="12"><div class="title"><h5>操作提示</h5><span class="arrow"></span></div></th>
		</tr>
		<tr>
			<td><ul>
				<li>所有会员</li>
				</ul></td>
		</tr>
	</tbody>
</table>
	<form method="post" id="form1">
    <table class="table tb-type2">
      <thead>
        <tr class="thead">
          <th class="w48 align-center">ID</th>
          <th>openID</th>
          <th class="align-center">会员昵称</th>
          <th class="w108 align-center">来自渠道</th>
          <th class="w108 align-center">VIP</th>
          <th class="w108 align-center">关注时间</th>
          <th class="w48 align-center">购买次数</th>
          <th class="w108 align-center">最后购买时间</th>
          <th class="w120 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="vo">
        <tr class="hover">
          <td class="align-center">{$vo['member_id']}</td>
          <td>{$vo['openid']}</td>
          <td class="align-center">{$vo['nickname']}</td>
          <php>$vo['channel'] = str_replace('qrscene_', '', $vo['channel']);</php>
          <td class="align-center">{$channel[$vo['channel']]}</td>
          <td class="align-center"><eq name="vo.vip" value="1">是<else />否</eq></td>
          <td class="align-center">{$vo['subscribe_time']|time_format}</td>
          <td class="align-center">{$vo['order_count']}</td>
          <td class="align-center">{$vo['last_buy_time']|time_format}</td>
          <td class="align-center">
          	<a href="{:U('edit?id='.$vo['member_id'])}">编辑</a>  
          	<!-- <a href="javascript:if(confirm('您确定要删除吗'))window.location = '{:U('delete?id='.$vo['member_id'])}';">删除</a> -->
          </td>
        </tr>
        </volist>
        <else />
        <tr class="no_data">
          <td colspan="10">没有符合条件的记录</td>
        </tr>
        </notempty>
      </tbody>
      <tfoot>
        <tr class="tfoot">
        <notempty name="page">
          <td><!--<input type="checkbox" class="checkall" id="checkallBottom">--></td>
          <td colspan="16"><!-- <label for="checkallBottom">全选</label>
            &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn" onclick="if(confirm('您确定要删除吗?')){$('#form1').submit();}"><span>删除</span></a> -->
            <div class="pagination"> {$page} </div></td>
         <else />  
          <td colspan="16"></td>
         </notempty>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
  <script type="text/javascript" src="__JS__/jquery-ui/jquery.ui.js"></script>
  <script type="text/javascript" src="__JS__/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
  <link rel="stylesheet" type="text/css" href="__JS__/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
  <script type="text/javascript">
    $(document).ready(function(){
      $('#start_subscribe_time').datepicker({dateFormat: 'yy-mm-dd'});
      $('#end_subscribe_time').datepicker({dateFormat: 'yy-mm-dd'});
    });
  </script>
</block>